﻿/*
 * Copyright © 2011 Tristan Reeves, treeves@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sprinkles.Attributes;

namespace Sprinkles.Tests.AttributeTestClasses
{
    [Export("my-big-container", IsSingleton = false)]
    public class BigContainer
    {
        public ILoggingService Log { get; set; }
        public IEmailService Es { get; set; }
        public EmailService2 Es2 { get; set; }
        public IDatabaseService Ds { get; set; }
        public int SomeInteger { get; set; }
        public object Nullable { get; set; }
        public StringBuilder Sb { get; set; }

        [UseConstructor]
        public BigContainer
        (
            [Import]ILoggingService log, 
            [Import(ImportResolutionType.Auto)]IEmailService es,
            [Import("my-email-service-2")]EmailService2 es2,
            [Import(ImportResolutionType.Ref, "my-database-service")]IDatabaseService ds, 
            [Import(ImportResolutionType.Literal, 77)]int someInteger, 
            [Import(ImportResolutionType.Literal, null)] object nullable,
            [Import(ImportResolutionType.SpEL, "new System.Text.StringBuilder('I am a walrus, not the walrus')")]StringBuilder sb
        )
        {
            Log = log;
            Es = es;
            Es2 = es2;
            Ds = ds;
            SomeInteger = someInteger;
            Nullable = nullable;
            Sb = sb;
        }
    }
}
